﻿<?php
  @header("content-Type: text/html; charset=utf-8"); //语言强制
	require_once('head.php');
?>

<link rel="stylesheet" href="/css/table.css" type="text/css"/>

<br/>

<table class="t1"> 
<thead><th>序号</th><th>股东</th><th>时间</th><th>股票代码</th><th>股票名称</th><th>占股数量</th><th>占股比例</th></thead>
 
<?php  
  // Connect to the database 
  $dbc = mysqli_connect('localhost', 'root', 'k00l@1D;', 'gudahu')
    or die('Error connecting to MySQL server.');
	mysqli_set_charset($dbc, 'utf8');
  // Retrieve the score data from MySQL
  $query = "SELECT th.holder_name, th.appear_date, th.stock_code, s.name, th.share_amount, th.share_ratio FROM top_holder th inner join stock s on th.stock_code = s.code where th.stock_code in (select distinct stock_code from rsi_week_toper) and th.appear_date = '2013-03-31' and th.share_ratio < 10 order by th.share_ratio desc";
  $result = mysqli_query($dbc, $query)
    or die('Error querying database.');  
  $isLine2 = false;
  $seq = 1;
  while ($row = mysqli_fetch_array($result)) {   	  
  	  if ($isLine2) {
  	  	echo '<tr class="a1">';
  	  	$isLine2 = false;
  	  } else {
  	  	echo '<tr>';
  	  	$isLine2 = true;
  	  }
  	  
      echo '<td>'.$seq.'</td>';
      echo '<td>'.$row['holder_name'].'</td>';
      echo '<td>'.$row['appear_date'].'</td>';
      echo '<td><a target="_blank" href="http://www.gudahu.com/topHolderDetail.php?code='.$row['stock_code'].'">'.$row['stock_code'].'</a></td>';
      echo '<td>'.$row['name'].'</td>';
      echo '<td>'.$row['share_amount'].'</td>';
      echo '<td>'.$row['share_ratio'].'%</td>';
      echo '</tr>';
      $seq++;
  }					    
  mysqli_close($dbc);
?>

</table>

<?php
	require_once('foot.php');
?>  
